package com.ims.core.doc.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ims.common.annotation.Log;
import com.ims.common.core.controller.BaseController;
import com.ims.common.core.domain.AjaxResult;
import com.ims.common.enums.BusinessType;
import com.ims.core.doc.domain.TInNon1010;
import com.ims.core.doc.service.ITInNon1010Service;
import com.ims.common.utils.poi.ExcelUtil;
import com.ims.common.core.page.TableDataInfo;

/**
 * 火车票退票费1010Controller
 *
 * @author IMS
 * @date 2024-11-20
 */
@RestController
@RequestMapping("/doc/huochepiaotuifei")
public class TInNon1010Controller extends BaseController
{
    @Autowired
    private ITInNon1010Service tInNon1010Service;

    /**
     * 查询火车票退票费1010列表
     */
    @PreAuthorize("@ss.hasPermi('doc:huochepiaotuifei:list')")
    @GetMapping("/list")
    public TableDataInfo list(TInNon1010 tInNon1010)
    {
        startPage();
        List<TInNon1010> list = tInNon1010Service.selectTInNon1010List(tInNon1010);
        return getDataTable(list);
    }

    /**
     * 导出火车票退票费1010列表
     */
    @PreAuthorize("@ss.hasPermi('doc:huochepiaotuifei:export')")
    @Log(title = "火车票退票费1010", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TInNon1010 tInNon1010)
    {
        List<TInNon1010> list = tInNon1010Service.selectTInNon1010List(tInNon1010);
        ExcelUtil<TInNon1010> util = new ExcelUtil<TInNon1010>(TInNon1010.class);
        util.exportExcel(response, list, "火车票退票费1010数据");
    }

    /**
     * 获取火车票退票费1010详细信息
     */
    @PreAuthorize("@ss.hasPermi('doc:huochepiaotuifei:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(tInNon1010Service.selectTInNon1010ById(id));
    }

    /**
     * 新增火车票退票费1010
     */
    @PreAuthorize("@ss.hasPermi('doc:huochepiaotuifei:add')")
    @Log(title = "火车票退票费1010", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TInNon1010 tInNon1010)
    {
        return toAjax(tInNon1010Service.insertTInNon1010(tInNon1010));
    }

    /**
     * 修改火车票退票费1010
     */
    @PreAuthorize("@ss.hasPermi('doc:huochepiaotuifei:edit')")
    @Log(title = "火车票退票费1010", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TInNon1010 tInNon1010)
    {
        return toAjax(tInNon1010Service.updateTInNon1010(tInNon1010));
    }

    /**
     * 删除火车票退票费1010
     */
    @PreAuthorize("@ss.hasPermi('doc:huochepiaotuifei:remove')")
    @Log(title = "火车票退票费1010", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tInNon1010Service.deleteTInNon1010ByIds(ids));
    }
}
